﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;

namespace WeiboPlus.Shell.Converter
{
    public class IntToAccentColorConverter :IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null && value is int)
            {
                switch ((int)value)
                {
                    case 0:
                        return AccentColors.Purple;
                    case 1:
                        return AccentColors.Teal;
                    case 2:
                        return AccentColors.Lime;
                    case 3:
                        return AccentColors.Brown;
                    case 4:
                        return AccentColors.Pink;
                    case 5:
                        return AccentColors.Orange;
                    case 6:
                        return AccentColors.Blue;
                    default:
                        return new SolidColorBrush(Colors.White);
                }
            }
            else
                return new SolidColorBrush(Colors.White);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class AccentColors
    {
        public static SolidColorBrush Purple = new SolidColorBrush(Colors.Purple);
        public static SolidColorBrush Teal = new SolidColorBrush(Color.FromArgb(0xFF,0x00,0x80,0x80));
        public static SolidColorBrush Lime = new SolidColorBrush(Color.FromArgb(0xFF, 0x00,0xFF,0x00));
        public static SolidColorBrush Brown = new SolidColorBrush(Colors.Brown);
        public static SolidColorBrush Pink = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xC0, 0xCB));
        public static SolidColorBrush Orange = new SolidColorBrush(Colors.Orange);
        public static SolidColorBrush Blue = new SolidColorBrush(Colors.Blue);

    }
}
